<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="../assets/lib/NProgress/NProgress.css" />
  </head>
  <body>
    <script src="../assets/lib/NProgress/NProgress.js"></script>
    <script src="../assets/lib/axios.js"></script>
    <script>
      axios.interceptors.request.use(
        function (config) {
          NProgress.start(); // 显示加载中
          return config;
        },
        function (error) {
          return Promise.reject(error);
        }
      );

      axios.interceptors.response.use(
        function (response) {
          NProgress.done(); // 关闭加载中
          return response;
        },
        function (error) {
          NProgress.done(); // 关闭加载中
          return Promise.reject(error);
        }
      );
      axios.defaults.baseURL = "http://hmajax.itheima.net";
        axios({
            url:'/api/province'
        }).then(res=>console.log(res))
    </script>
  </body>
</html>
